import http from "../tools/http"
import { RouteParamValue } from "vue-router"

//获取风险库列表
export function getRiskList(params: { type: string; pageIndex: number; pageSize: number }) {
  return http.get("/RiskRepository/GetRiskRepositoryList", params)
}

//添加风险
export function addRisk(params: {
  coding: string
  unit: string
  workTask: string
  time: string
  location: string
  workflow: string
  group_member: string
  step_details: string
  create_time: string
  update_time: string
}) {
  return http.post("/RiskRepository/AddRiskRepository", params)
}

//获取风险详情
export function GetRiskRepositoryDetail(id: string | RouteParamValue[]) {
  return http.get("/RiskRepository/GetRiskRepositoryDetail", { id })
}
// 更新风险
export function updateRisk(params: {
  id: string
  coding: string
  unit: string
  workTask: string
  time: string
  location: string
  workflow: string
  group_member: string
  step_details: string
  create_time: string
  update_time: string
}) {
  return http.post("/RiskRepository/UpdateRiskRepository", params)
}
